/***************************************** 
 * Desc: UGUI图片Inspector
*****************************************/

using Common.UGUI.View;
using UnityEditor;
using UnityEngine;

namespace Common.UserEditor.UGUIViewSpace {

	[CustomEditor(typeof(UGUIImage))]
	[CanEditMultipleObjects]
	public class UGUIImageInspector : Editor {

		public override void OnInspectorGUI() {

			UnityEngine.Object[] objects = targets;
			int len = objects.Length;
			UGUIImage[] images = new UGUIImage[len];
			for (int i = 0; i < len; ++i) {
				images[i] = (UGUIImage)objects[i];
			}

			foreach (var oneImage in images) {

				oneImage.Image.raycastTarget = false;
			}

			UGUIPanelInspector.ShowUGUIPanel(images, base.OnInspectorGUI);

			//GUILayout.Space(UnityEditorCommonConfig.GUILayoutGapSpace);

			GUILayout.Label("注意,UGUIImage 的 raycastTarget 只能为false，否则用UGUIPanel.", UGUIViewInspector.UGUIViewStatusLabel, GUILayout.ExpandWidth(false));
		}
	}
}